package softtest3;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvFileSource;
import org.junit.jupiter.params.provider.CsvSource;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.text.ParseException;
public class billtest {

    @DisplayName(value="等价类测试")//等价类测试
    @ParameterizedTest
    @CsvFileSource(resources = "/equivalence class.csv",numLinesToSkip =1,encoding = "UTF-8")
    void test1(int m,String time1,String time2,double expected,String k) throws ParseException {
        bill c1 = new bill();
        long minutes = c1.checkTime(time1,time2);
        double money = c1.CountMoney(minutes);
        assertEquals(expected,money,0.000001);
    }
    @DisplayName(value="边界值测试")//边界值测试
    @ParameterizedTest
    @CsvFileSource(resources = "/Boundary value test.csv",numLinesToSkip =1,encoding = "UTF-8")
    void test2(int m,String time1,String time2,double expected,String k) throws ParseException {
        bill c1 = new bill();
        long minutes = c1.checkTime(time1,time2);
        double money = c1.CountMoney(minutes);
        assertEquals(expected,money,0.000001);
    }


}
